<template>
  <el-dialog
    v-bind="$attrs"
    v-on="$listeners"
    :visible.sync="DialogVisibleThis"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    :fullscreen="changeDialogFlagThis"
    :width="width"
  >
    <div slot="title">
      <div>
        <span class="el-dialog__title" v-if="!validatenull(title)">{{title}}</span>
        <div class="avue-crud__dialog__menu">
          <button class="el-dialog__headerbtn" style="margin-right:20px" @click.stop="changeDialog">
            <i class="el-dialog__close el-icon-full-screen"></i>
          </button>
        </div>
        <button type="button" aria-label="Close" class="el-dialog__headerbtn">
          <i class="el-dialog__close el-icon el-icon-close"></i>
        </button>
      </div>
    </div>
    <slot></slot>
    <template slot="footer">
      <slot name="footer"></slot>
    </template>
  </el-dialog>
</template>

<script>
export default {
  name: "OpenDialog",
  data() {
    return {
      DialogVisibleThis: false,
      changeDialogFlagThis:false,
    };
  },
  props: {
    title: String,
    width: {
      type: String,
      default: "70%",
    },
    DialogVisible: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    DialogVisibleThis: function () {
      return this.$emit("update:DialogVisible", this.DialogVisibleThis);
    },
    DialogVisible() {
      this.DialogVisibleThis = this.DialogVisible;
    },
  },
  computed: {},
  created() {},
  methods: {
    changeDialog: function () {
      this.changeDialogFlagThis = !this.changeDialogFlagThis;
    },
  },
};
</script>

<style>
</style>
